///引入共享头部
import '../../common/shard.dart';
///引入仓库
import '../../store/main.dart';

class DetailPage extends StatelessWidget {
	const DetailPage({Key? key}) : super(key: key);

	@override
	Widget build(BuildContext context) {
		String hello = Get.arguments;
		return GetBuilder<MainStore>(builder: (store){
			return CustomCupertinoScaffold(
				titleText: "详情页",
                navBackgroundColor: Theme.of(context).primaryColor,
				body: Column(
					mainAxisAlignment: MainAxisAlignment.center,
					crossAxisAlignment: CrossAxisAlignment.center,
					children:  [
						Text(hello),
						Text("当前是否登录：${store.isLogin}"),
						TextButton(
							onPressed: (){
								store.isLogin=!store.isLogin;
								store.update();
							},
							child: const Text("切换登录状态")
						),
						TextButton(
							onPressed: (){
								List testList=['1','2','3'];
								Get.toNamed('/detail2',arguments: testList);
							},
							child: const Text("继续下一页")
						)
					],
				),
			);
		});
	}
}
